package org.jiamandan.com.strategy.enums;

import org.jiamandan.com.constant.BizConstant;

/**
 * @version Revision 1.0.1
 * @版权：版权所有 (c) 2021
 * @author:Jmd

 * @see:
 * @创建日期：2022-11-30 18:01
 * @功能说明：
 * @begin
 * @修改记录:
 * @修改后版本 修改人        修改内容
 * @2022-11-30 18:01	         Jmd        	创建
 * @end
 */
public enum ZDEventTagEnum {

    //智点
    CMD_1(BizConstant.Cmd.CMD_2, BizConstant.CmdClass.CMD_2_SERVICE),
    CMD_101(BizConstant.Cmd.CMD_101, BizConstant.CmdClass.CMD_101_SERVICE),
    CMD_102(BizConstant.Cmd.CMD_102, BizConstant.CmdClass.CMD_102_SERVICE),
    CMD_106(BizConstant.Cmd.CMD_106, BizConstant.CmdClass.CMD_106_SERVICE),
    CMD_110(BizConstant.Cmd.CMD_110, BizConstant.CmdClass.CMD_110_SERVICE),
    CMD_112(BizConstant.Cmd.CMD_112, BizConstant.CmdClass.CMD_112_SERVICE),
    CMD_302(BizConstant.Cmd.CMD_302, BizConstant.CmdClass.CMD_302_SERVICE),
    CMD_306(BizConstant.Cmd.CMD_306, BizConstant.CmdClass.CMD_306_SERVICE),
    CMD_310(BizConstant.Cmd.CMD_310, BizConstant.CmdClass.CMD_310_SERVICE),
    CMD_314(BizConstant.Cmd.CMD_314, BizConstant.CmdClass.CMD_314_SERVICE),
    CMD_318(BizConstant.Cmd.CMD_318, BizConstant.CmdClass.CMD_318_SERVICE),
    CMD_322(BizConstant.Cmd.CMD_322, BizConstant.CmdClass.CMD_322_SERVICE),
    CMD_501(BizConstant.Cmd.CMD_501, BizConstant.CmdClass.CMD_501_SERVICE),
    CMD_502(BizConstant.Cmd.CMD_502, BizConstant.CmdClass.CMD_502_SERVICE),
    CMD_503(BizConstant.Cmd.CMD_503, BizConstant.CmdClass.CMD_503_SERVICE),
    CMD_504(BizConstant.Cmd.CMD_504, BizConstant.CmdClass.CMD_504_SERVICE),
    CMD_505(BizConstant.Cmd.CMD_505, BizConstant.CmdClass.CMD_505_SERVICE),
    CMD_506(BizConstant.Cmd.CMD_506, BizConstant.CmdClass.CMD_506_SERVICE),
    CMD_507(BizConstant.Cmd.CMD_507, BizConstant.CmdClass.CMD_507_SERVICE),
    CMD_508(BizConstant.Cmd.CMD_508, BizConstant.CmdClass.CMD_508_SERVICE),
    CMD_704(BizConstant.Cmd.CMD_704, BizConstant.CmdClass.CMD_704_SERVICE),
    CMD_901(BizConstant.Cmd.CMD_901, BizConstant.CmdClass.CMD_901_SERVICE),
    //JMD-YD
    //设备======
    CMD_YD_20(BizConstant.Cmd.CMD_YD_20, BizConstant.CmdClass.CMD_YD_20_SERVICE),
    CMD_YD_21(BizConstant.Cmd.CMD_YD_21, BizConstant.CmdClass.CMD_YD_21_SERVICE),
    CMD_YD_22(BizConstant.Cmd.CMD_YD_22, BizConstant.CmdClass.CMD_YD_22_SERVICE),
    CMD_YD_12(BizConstant.Cmd.CMD_YD_12, BizConstant.CmdClass.CMD_YD_12_SERVICE),
    CMD_YD_02(BizConstant.Cmd.CMD_YD_02, BizConstant.CmdClass.CMD_YD_02_SERVICE),
    CMD_YD_03(BizConstant.Cmd.CMD_YD_03, BizConstant.CmdClass.CMD_YD_03_SERVICE),
    CMD_YD_06(BizConstant.Cmd.CMD_YD_06, BizConstant.CmdClass.CMD_YD_06_SERVICE),
    CMD_YD_82(BizConstant.Cmd.CMD_YD_82, BizConstant.CmdClass.CMD_YD_82_SERVICE),
    CMD_YD_8a(BizConstant.Cmd.CMD_YD_8a, BizConstant.CmdClass.CMD_YD_8a_SERVICE),
    CMD_JSY_A0(BizConstant.Cmd.CMD_JSY_A0, BizConstant.CmdClass.CMD_JSY_A0_SERVICE);

    private String key;

    private String value;

    ZDEventTagEnum(String key, String index) {
        this.key = key;
        this.value = index;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    //通过key-获取value
    public static String getValueByKey(String key) {
        for (ZDEventTagEnum contextEnum : ZDEventTagEnum.values()) {
            if (key.equals(contextEnum.key)) {
                return contextEnum.getValue();
            }
        }
        return "";
    }

    //通过vale-获取key
    public static String getKeyByValue(String value) {
        for (ZDEventTagEnum contextEnum : ZDEventTagEnum.values()) {
            if (value.equals(contextEnum.value)) {
                return contextEnum.getKey();
            }
        }
        return "0";
    }
}
